@using InvoiceProject.Helpers
@using InvoiceProject.Models
@model InvoiceProject.Models.Invoice
@* 

This partial view defines form fields that will appear when creating and editing entities *@
<div id="orderMaster">
    <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">Invoice Details</li>
        <li data-role="fieldcontain">
            @Html.LabelFor(m => m.InvoiceDate, new { @class = "ui-input-text" })
            @Html.EditorFor(m => m.InvoiceDate)
            @Html.ValidationMessageFor(m => m.InvoiceDate)
        </li>
        <li data-role="fieldcontain">
            @Html.LabelFor(m => m.TotalTax)
            @Html.EditorFor(m => m.TotalTax)
            @Html.ValidationMessageFor(m => m.TotalTax)
        </li>
        <li data-role="fieldcontain">
            @Html.LabelFor(m => m.TotalIncTax)
            @Html.EditorFor(m => m.TotalIncTax)
            @Html.ValidationMessageFor(m => m.TotalIncTax)
        </li>
        <li data-role="fieldcontain">
            <label for="TotalIncTax" class="ui-input-text">
            </label>
            <div style="text-align: right">
                <a href="#" id="add" data-role="button" data-icon="plus" data-inline="true">Add invoice
                    item</a>
            </div>
        </li>
    </ul>
    <ul data-role="listview" data-inset="true" id="orderDetail">
        <li data-role="list-divider">Invoice Items </li>
        @if (Model.InvoiceItems != null)
        {
           foreach (var x in Model.InvoiceItems)
            {
                using (Html.BeginCollectionItem("InvoiceItems"))
                {

                    Html.RenderPartial("InvoiceItem", x);

                }

            }
        }
    </ul>
    <script id="OrderLine" type="text/x-jQuery-tmpl">
  
    @using (Html.BeginCollectionItem("InvoiceItems", true))
    {
        Html.RenderClientTemplate(typeof(InvoiceProject.Models.InvoiceItem), "InvoiceItem");

    } 
   
    </script>
</div>
